<template>
  <div id="app">
<img :src="dogImgUrl" alt="">
<p :style="{ backgroundColor: colorStr }" @click="btn">{{dogName}}</p>

  </div>
</template>

<script>
export default {
props: ['dogImgUrl','dogName'],
methods: {
  btn(){
      this.colorStr = `rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(
        Math.random() * 256
      )}, ${Math.floor(Math.random() * 256)})`;
  }
},
data () {
  return {
    colorStr:''
  }
}
}
</script>

<style >
#app {
  width: 200px;
  border: 1px solid black;
  text-align: center;
  float: left;
}

#app img {
  width: 100%;
  height: 200px;
}
</style>